//-----------------------------------------------------------------------
//<copyright file="NhomHangBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class NhomHangBO : BaseBO
	{
		// Interface Instant Object
		private readonly INhomHangDAO nhomhangInterfaceObject = null;

		// Constructor
		public NhomHangBO()
		{
			nhomhangInterfaceObject = new DAL.ServiceFactory<INhomHangDAO>().CurrentDAL;
		}

		#region NhomHang

		/// <summary>
		///
		/// </summary>
		/// <param name="nhomhang"></param>
		public NhomHang CreateNhomHang(NhomHang nhomhang)
		{
			try
			{
				return nhomhangInterfaceObject.CreateNhomHang(nhomhang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreateNhomHang Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="nhomhang"></param>
		public void UpdateNhomHang(NhomHang nhomhang)
		{
			try
			{
				nhomhangInterfaceObject.UpdateNhomHang(nhomhang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdateNhomHangException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="nhomhang"></param>
		public void DeleteNhomHang(NhomHang nhomhang)
		{
			try
			{
				nhomhangInterfaceObject.DeleteNhomHang(nhomhang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeleteNhomHangException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public NhomHangs GetAllNhomHang()
		{
			try
			{
				return nhomhangInterfaceObject.GetAllNhomHang();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllNhomHang Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="maNH"></param>
		public NhomHang GetNhomHangByID(string maNH)
		{
			try
			{
				return nhomhangInterfaceObject.GetNhomHangByID(maNH);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetNhomHangBy ID Exception", ex);
			}
		}

		#endregion
	}
}
